﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Registration : Form
    {
        Form home = null;
        int checker = 0;


        public Registration(Form back)
        {
            home = back;
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //lagay sa dtabase pakshet
            //lagyan mo nalang ng stuff na pang check kung dapat lang talga makagay sa database yung nilagay nung user.parang  checker shet

            

            if (MessageBox.Show("Are you sure of the deatils of this account?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {

                TabPage current = registrationtabs.SelectedTab;
                if (current == college)
                {
                    //lagay sa db pero chcheck mo muna kung valid nga..function call

                }
                else if (current == organization)
                {


                    //lagay sa db pero chcheck mo muna kung valid nga..function call


                }
                else
                {
                    // lagay sa db pero chcheck mo muna kung valid nga..function call
                }


                MessageBox.Show("Account Registered!");
                home.Show();
                checker = 1;
                this.Close();
           
            
            
            
            }
            
        }

        private void registration_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (checker == 0)
            {
                if (MessageBox.Show("Are you sure you want to cancel creating an account?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    home.Show();
                }
                else
                {
                    e.Cancel = true;
                }
            }
        }
        private void Cancel_Click(object sender, EventArgs e)
        {
          
            this.Close();
        }

    

     
     

     
    

       
    }
}
